<%= render :partial => 'menu' -%>

<%= link_to "Add Product", :action => 'new' -%>

<br/><br/>			

<h1>Listing products</h1>
<table>
	<tr>
		<td valign="top">
			<table class="admin-report" width="545">
			  <tr>
			    <td><b>Image</b></td>
			    <td><b>Sku</b></td>
			    <td><b>Title</b></td>
			    <td><b>Price</b></td>
			    <td><b>Tags</b></td>
			    <td/>
			  </tr>
			<% for product in @products%>
			  <tr>
			    <td><%= mini_image(product) %></td>
			    <td valign="top"><%=product.sku%></td>
			    <td valign="top"><%=product.name%></td>
			    <td valign="top"><%=product.price%></td>
			    <td valign="top"><%=product.tag_list%></td>
			    <td valign="top">
			      <%= link_to "Show", :action => 'show', :id => product -%>
			      <%= link_to "Edit", :action => 'edit', :id => product -%>
			      <%= link_to "Delete", {:action => 'destroy', :id => product}, :confirm => "Are you sure you want to delete this product?" -%>
			    </td>
			  </tr>
			<% end %>
			</table>
			<%= render :partial => 'shared/paginate', :locals => {:collection => @products, :options => search_options} -%>						
		</td>
    <td valign="top">
      <% form_for :search do |f| %>
        <div id="search-col">
          <table class="admin-search">
            <thead>
              <tr>
                <th colspan="2">Product Details</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td>Name</td>
                <td>
                  <%= f.text_field :name, :size=>15 %>
                </td>
              </tr>
              <tr>
                <td>Sku</td>
                <td>
                  <%= f.text_field :sku, :size=>15 %>
                </td>
              </tr>
            </tbody>
          </table>
          <%=submit_tag "Search"%>
        </div>
      <% end %>
    </td>		
	</tr>
</table>
